<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript 获取复选框的值</title>
</head>
<body>
<script src="../js/jquery.min.js"></script>
<script>
    function checkbox()
    {
        var str=document.getElementsByName("box");
        var objarray=str.length;
        var chestr="";
        for (i=0;i<objarray;i++)
        {
            if(str[i].checked == true)
            {
                chestr+=str[i].value+",";
            }
        }
        if(chestr == "")
        {
            alert("请先选择复选框～！");
        }
        else
        {
            alert("复选框的值是："+chestr);
            ajaxdel();
        }
    }

</script>
选择您的拿手技术：
<input type="checkbox" name="box" id="box1" value="ASP" />ASP
<input type="checkbox" name="box" id="box2" value="PHP" />PHP
<input type="checkbox" name="box" id="box3" value="JSP" />JSP
<input type="button" name="button" id="buttoni" value="提交" />
</body>
</html>